<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="/template/_template.xhtml">
      <ui:define name="conteudo">
		<h:form>
			<h:messages/>
     	<h:dataTable  value="#{publicacaoBean.lista}" var="publicacao" rules="rows" cellpadding="5">
     	<f:facet name="caption">
     	A listagem a seguir exibe a relação de todos as publicações do sistema.
     	</f:facet>
     	<f:facet name="header">Listagem de Publicações</f:facet>
     	<f:facet name="footer">Final da Listagem de Publicações</f:facet>
     	<h:column>
		<h:inputHidden value="#{publicacao.nomeOrientador}"></h:inputHidden>
     	</h:column>
     	<h:column>
     	<f:facet name="header">Orientador</f:facet>
     	#{publicacao.nomeOrientador}
     	</h:column>
     	<h:column>
     	<f:facet name="header">Aluno</f:facet>
     	#{publicacao.nomeAluno}
     	</h:column>
     	<h:column>
     	<f:facet name="header">Titulo</f:facet>
     	#{publicacao.titulo}
     	</h:column>
     	<h:column>
     	<f:facet name="header">Tipo</f:facet>
     	#{publicacao.tipo}
     	</h:column>
     	<h:column>
     	<h:commandLink action="#{publicacaoBean.editar}">
     	<h:graphicImage library="img" name="editar.png" style="border:0"/>
     	<f:setPropertyActionListener target="#{publicacaoBean.publicacaoAlunoOrientador}" value="#{publicacao}"/>
     	</h:commandLink>
     	</h:column>
     	<h:column>
     	<h:commandLink action="#{publicacaoBean.excluirPublicacaoLista}" onclick="if(!confirm('Confirma a exclusão da publicação: #{publicacao.titulo}?')) return false;">
     	<h:graphicImage library="img" name="excluir.png" style="border:0"/>
     	<f:setPropertyActionListener target="#{publicacaoBean.publicacaoAlunoOrientador}" value="#{publicacao}"/>
     	</h:commandLink>
     	</h:column>
     	</h:dataTable>
		</h:form>
	 </ui:define>
     </ui:composition>
</html>